<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
    'basePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..',
    'name' => 'Mspares',
    'defaultController' => 'main/index',
    'language' => 'ru',
    // preloading 'log' component
    'preload' => array('log'),
    // autoloading model and component classes
    'import' => array(
        'application.models.*',
        'application.components.*',
        'ext.ipgeobase.IPGeoBase',
    ),
    'aliases' => array(
        'widgets' => realpath(__DIR__ . '/../widgets'),
    ),
    'modules' => array(
        // uncomment the following to enable the Gii tool

        'gii' => array(
            'class' => 'system.gii.GiiModule',
            'password' => '111',
            // If removed, Gii defaults to localhost only. Edit carefully to taste.
            'ipFilters' => array('127.0.0.1', '::1'),
        ),
    ),
    // application components
    'components' => array(
        'clientScript' => array(
            'packages' => array(
                'jquery' => false,
                'yiiactiveform' => false,
            ),
            'coreScriptPosition' => CClientScript::POS_END,
        ),
        'user' => array(
            // enable cookie-based authentication
            'allowAutoLogin' => true,
        ),
        // uncomment the following to enable URLs in path-format
        'urlManager' => array(
            'urlFormat' => 'path',
            'rules' => array(
                'gii' => 'gii',
                'gii/<controller:\w+>' => 'gii/<controller>',
                'gii/<controller:\w+>/<action:\w+>' => 'gii/<controller>/<action>',
                'search' => 'main/search',
                'market' => 'ajax/search',
                'order' => 'main/order',
                '<controller:ajax+>/<action:\w+>' => 'ajax/<action>',
                'main/login' => 'main/login',
                array(
                    'class' => 'application.components.MainRouter',
                    'connectionID' => 'db',
                ),
            ),
            'showScriptName' => false,
        ),
        // database settings are configured in database.php
        'db' => require(dirname(__FILE__) . '/database.php'),
        'authManager' => array(
            'class' => 'CDbAuthManager',
            'connectionID' => 'db',
        ),
        'errorHandler' => array(
            // use 'site/error' action to display errors
            'errorAction' => 'main/error',
        ),
        'log' => array(
            'class' => 'CLogRouter',
            'routes' => array(
                array(
                    'class' => 'CFileLogRoute',
                ),
                // uncomment the following to show log messages on web pages
                array(
                    'class' => 'CWebLogRoute',
                    'levels' => 'error, warning, notice, trace',
                ),
            ),
        ),
    ),
    // application-level parameters that can be accessed
    // using Yii::app()->params['paramName']
    'params' => array(
        // this is used in contact page
        'regions' => array(1 =>
            array('regionTitle' => 'Москва и МО', 'genitive' => 'Москве', 'id' => 1),
            array('regionTitle' => 'Санкт-Петербург', 'genitive' => 'Санкт-Петербурге', 'id' => 2),
            array('regionTitle' => 'Нижний Новгород', 'genitive' => 'Нижнем Новгороде', 'id' => 3),
            array('regionTitle' => 'Екатеринбург', 'genitive' => 'Екатеринбурге', 'id' => 4),
            array('regionTitle' => 'Новосибирск', 'genitive' => 'Новосибирске', 'id' => 5),
            array('regionTitle' => 'Казань', 'genitive' => 'Казани', 'id' => 6),
        ),
        'adminEmail' => 'm.nishanov@x8group.ru',
    ),
);
